//#define __FORCE_TRACE__
//#define __FORCE_DEBUG__
//#define __FORCE_INFO__
#define THIS_FILE "tools\fn_createMarker.sqf"
#include <tmf_constants.h>
#include <tmf_macros.h>

TRACE_1("Start",_this);
TMFPROFILERSTART;

private ["_m_name","_m_pos","_m_shape","_m_col","_m_size","_m_text","_m_dir","_m_type","_m_brush","_m_alpha"];
DEFAULT_PARAM(_m_name,0,"");
DEFAULT_PARAM(_m_pos,1,ARR_3(0,0,0));
DEFAULT_PARAM(_m_shape,2,"");
DEFAULT_PARAM(_m_col,3,"");
DEFAULT_PARAM(_m_size,4,[]);
DEFAULT_PARAM(_m_text,5,"");
DEFAULT_PARAM(_m_dir,6,-888888);
DEFAULT_PARAM(_m_type,7,"");
DEFAULT_PARAM(_m_brush,8,"");
DEFAULT_PARAM(_m_alpha,9,-888888);

if (IS_ARRAY((_m_pos select 0))) then {
	_m_dir = GETVAL(_m_pos,1,-888888);
	_m_pos = GETVAL(_m_pos,0,ARR_3(0,0,0));
};

if (!IS_MARKER(_m_name)) then {
	_m_name = createMarker [_m_name, _m_pos];
};

if (_m_shape != "") then {_m_name setMarkerShape _m_shape};
if (_m_col != "") then {_m_name setMarkerColor _m_col};
if (count _m_size > 0) then {_m_name setMarkerSize _m_size};
if (_m_text != "") then {_m_name setMarkerText (_m_text call FFUNC(translate))};
if (_m_dir > -1000) then {_m_name setMarkerDir _m_dir};
if (_m_type != "") then {_m_name setMarkerType _m_type};
if (_m_brush != "") then {_m_name setMarkerBrush _m_brush};
if (_m_alpha > -1000) then {_m_name setMarkerAlpha _m_alpha};
	
TRACE_1("End",_m_name);
TMFPROFILERSTOP;
_m_name;